﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ValidationLibrary
{
    public class ValidationResult<T>
    {
        public IList<ValidationRuleResult<T>> RuleResults { get; private set; }

        public ValidationResult(IList<ValidationRuleResult<T>> ruleResults)
        {
            RuleResults = ruleResults;
        }

        public bool Valid
        {
            get
            {
                return RuleResults.Count(x => x.Valid == false) == 0;
            }
        }
    }
}
